<template>
  <div class='adviser first-box'>
    <MyAdviser class="marginTop0" :listData="listData" :operateShow="operateShow" v-if="listData.length>0"></MyAdviser>
    <p v-else class="no-data">暂时没有数据</p>
  </div>
</template>
<script>
import MyAdviser from './myadviser.vue'
export default {
  components: {MyAdviser},
  name: "",
  data() {
    return {
      listData:[
        { 
          id:1,//顾问id
          roleId:"",//用户id
          name:"马漂亮",
          pic:"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1533807483897&di=806e9d941e7ea15c82437d699a42aa7d&imgtype=0&src=http%3A%2F%2Fp2.gexing.com%2FG1%2FM00%2F83%2F4E%2FrBACE1ToAmbz_TgZAAAkpbJV-BU277_200x200_3.jpg%3Frecache%3D20131108", //照片
          sex:1, //1男，2女
          phone:"12354678999",
          wx:"hhda", //微信号
          type:"",//保险顾问；续保顾问,保养顾问
        }
      ],

      // 是否显示操作栏
      operateShow:true,
    };
  },
  methods: {

    getList(){
      var params={
        // userId:sessionStorage.getItem("userId"),
        // phone:sessionStorage.getItem("userPhone"),
        // realName:sessionStorage.getItem("userName")
      }

      _g.apiPost("consultants/init.do",params).then(res=>{
        var goals=[]
        res.data.forEach(ele=>{
          goals.push({
            id:ele.employeeId,
            roleId:ele.roleId,
            name:ele.name,
            pic:ele.headPic||"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1533807483897&di=806e9d941e7ea15c82437d699a42aa7d&imgtype=0&src=http%3A%2F%2Fp2.gexing.com%2FG1%2FM00%2F83%2F4E%2FrBACE1ToAmbz_TgZAAAkpbJV-BU277_200x200_3.jpg%3Frecache%3D20131108",
            sex:ele.sex,
            phone:ele.phone,
            wx:ele.wx||"",
            type:ele.roleName
          })
        })
        this.$set(this,"listData",goals)
      })
    }
  },
  created() {
    this.getList()
  }
};
</script>
<style lang="scss" scoped>
.adviser{

}
</style>